<div class="entries_wrapper">
	<ul class="sm_grid_layout">
		<?php foreach ($this->paginator as $product): ?>
			<li>
				<div class="image_canvas">
					<div style="position:relative;">
					<div class="image_ca">
						<a href="<?php echo $this->pageUrl(array_merge($this->pageValues, array('target' => 'detail', 'id_product' => $product->id,'id_category'=>$product->getCustomCategory()->path))); ?>">
							<img class="pic_item" src="<?php echo $product->getPrimaryThumbImageUrl(); ?>"
								 title="<?php echo $this->escape($product->name); ?>"/>
						</a>
					</div>
					<?php echo $this->social->render('recommendUrl', array(
						'url'			=>  $product->getShareUrl(array('id_page' => $this->social->getIdPage())),
						'product'		=>	$product,
						'pageValues'	=>	$this->pageValues,
						'requestMessage' => $this->translate('REQUEST_MESSAGE'),
						'send' => false,
						'width' => 'auto',
						'show_faces'=>false
					));
					?>
					<div class="view_detail center">
						<div class="ellipsis title">
							<a href="<?php echo $this->pageUrl(array_merge($this->pageValues, array('target' => 'detail', 'id_product' => $product->id,  'id_category' => $product->getCustomCategory()->path))); ?>">
								<?php echo $this->escape($product->getProductName()); ?>
							</a>
						</div>
						<div class="ellipsis price">
                             <?php if(!empty($product->old_price)):?>
                                    <div class="sm_price right"><span class='sale_price'><?php echo (!empty($product->price))? $product->getPrice() : '&nbsp;'?></span><br><span class='old_price' ><?php echo $product->getOldPrice() ?></span> </div>
                                <?php else :?>
                                    <div class="sm_price right"><span class='sale_price'><?php echo (!empty($product->price))? $product->getPrice() : '&nbsp;'?></span></div>
                                <?php endif;?>
						</div>                        					
					</div>
					</div>
				</div>
			</li>
		<?php endforeach; ?>
	</ul>
</div>

<script>
	$('.image_canvas').ymProductItem();
</script>